Elliptic Billiard 2, version 1.0, 2025-08-15
Rolf Puetter

This program illustrates two theorems from the dynamics of elliptic billiards.

Let the curve c: R->R² be an ellipse in the Euclidean plane. We consider the path g of a billiard ball having intersection 
points x and y with c. The ball is reflected by the boundary c at the point y according to the laws of geometrical optics 
(angle of reflection equals angle of incidence). Let z be the next point where the ball meets the boundary. The oriented 
straight line through x and y is thus mapped onto the straight line through y and z. We write this as
T: xy->yz
T is a mapping on the space of straight lines which intersect c.

We have

Theorem 1: There exists a fixed conic section s confocal to c depending on xy such that the trajectory
xy, yz, Txz, TTyz,... will always be tangential to s.

The program illustrates this theorem by drawing the consecutive line segments (press Enter for the next segment)
of g (in black) and the conic section s (in green). Let F1 and F2 be the focal points of c. s is a hyperbola if xy 
intersects the line segment F1F2, an ellipse if it doesn't. If xy meets one of the focal points, yz will meet the other.  

If the billiard trajectory closes after n reflections, we call it n-periodic. Let its tangential conic section be the 
ellipse s. Then each billiard trajectory having s as tangential conic section will be n-periodic (Theorem 2).              

Start for example with a 5-periodic trajectory (by selecting "n=5" in the menu Periodic orbits) and its tangential ellipse s.
Press [+] to move the starting point  P1. The program then computes P2 in such a way that the segment P1P2 is tangential
to s and hence, according to Theorem 1, the complete orbit. Again the orbit closes after 5 steps (predicted by Theorem 2).

The program has two modi: "start" and "show". At the beginning, it is in modus "start". There you can modify the shape of
ellipse c (its eccentricity) by pressing the arrow keys. Press Enter to fix c and change to "show" mode. Here you can change 
the positions of P1 and P2 (= the starting points x and y). The trajectories and tangential conic sections are modified 
automatically.
If the tangential conic section is an ellipse, you can press [+] or [-] to move P1 only.


Controls

In "start" mode:

arrow up and down		change the hight of the blue ellipse (the billiard table)
arrow left and right           change the width
Enter				fix the billiard table and proceed to "show" mode

In "show" mode:

Tab:				toggle the highlight (a red cicle) between P1 (green) and P2 (red)
arrow left and right		change the curve parameter of highlighted point by 0.1
arrow up and down		change the curve parameter of highlighted point by 0.001 (fine tuning)
[+],[-]				if the tangential conic (green) is an ellipse: change the parameter of P1 by 0.02
[n]				start from scratch
Esc				start from scratch
Enter				make next step (=draw next line segment)
Backspace			take back one step
[d]				take back one step 